package com.taocyb.core.uc.manager;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.taocyb.commons.uc.entity.Seller;
import com.taocyb.commons.uc.vo.SellerVo;
import com.taocyb.core.uc.dao.SellerDao;
import com.taocyb.framework.orm.Page;

@Component
@Transactional(readOnly = true)
public class SellerManager{

	@Autowired
	private SellerDao sellerDao;
	
	public Page<Seller> findSellerList(SellerVo vo, Page<Seller> page) {
		int totalCount = sellerDao.findCount(vo);
		page.setTotalCount(totalCount);
		
		List<Seller> dataList = sellerDao.findList(vo, page);
		page.setDataList(dataList);
		
		return page;
	}
	
	public Long saveSeller(Seller seller){
		return sellerDao.save(seller);
	}
}